erDiagram
    users ||--|| user_quotas : "一对一"
    users ||--o{ audit_logs : "一对多"
    
    users {
        bigint user_id PK "主键"
        varchar username UK "用户名(唯一)"
        varchar password_hash "密码哈希"
        varchar salt "盐值"
        varchar email "邮箱"
        varchar role "角色"
        varchar status "状态"
        bigint created_at "创建时间"
        bigint updated_at "更新时间"
        bigint last_login "最后登录"
    }
    
    user_quotas {
        bigint quota_id PK "主键"
        bigint user_id FK "用户ID(外键唯一)"
        bigint total_quota "总配额"
        bigint used_quota "已使用"
        int file_count "文件数量"
        bigint created_at "创建时间"
        bigint updated_at "更新时间"
    }
    
    audit_logs {
        bigint log_id PK "主键"
        bigint user_id FK "用户ID(外键)"
        varchar action "操作"
        varchar ip_address "IP地址"
        text user_agent "用户代理"
        varchar status "状态"
        text error_message "错误信息"
        bigint created_at "创建时间"
    }
